<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
${r"<"}#include "/include/header.html"/>
</head>
<body>
 <form id="editForm">
	<input type="hidden" id="CSRFToken" name="CSRFToken" value="<hna:csrfToken />" />
	<input type="hidden" name="${columnList[0].javaPropertyName}" value="${r"${"}${simpleBeanName+"."+columnList[0].javaPropertyName}${r"}"}" /> 
	<div class="dialog_box">
			<table class="tableBlock">
				<#list columnList as column>		
				<#if column_index!=0>	
				<tr>
					<td class="tableTitle">${column.dbColumnComment}：</td>
					<td class="tableData"><input type="text" id="${column.javaPropertyName}"  name="${column.javaPropertyName}"  value="${r"${"}${simpleBeanName+"."+column.javaPropertyName}${r"}"}"  class="input_txt" /></td>
				</tr>
				</#if>				
				</#list>				
			</table>
	</div>
	<div class="action_box  m_t10 t_c"><input type="submit" class="save_btn" value="保存" id="addBtn"/></div>
</form>
<script type="text/javascript" src="${ctx}/js/plugin/nice-validator/jquery.validator.min.js?local=zh-CN"></script>	
<script type="text/javascript">
$(function(){
	$('#editForm').validator({
	    fields: {
		<#list columnList as column>
		<#if column_index!=0>			   
	        "#${column.javaPropertyName}": "required"<#if column_has_next>,</#if>
		</#if>	        
		</#list>	        
	    },
	    valid: function(form) {
			sysUtil.postJosn("${ctx}/${simpleBeanName}/edit.do", $("#editForm").serializeJson(), function(result) {
					if(result.isSucc){
						parent.search();
						alert("操作成功!");
						sysUtil.closeDialog();
					}else{
						alert(result.msg);
					}
			});	    
	    }
	});		
});
</script>
</body>
</html>